import 'package:flutter/material.dart';
import 'package:get/get.dart';

class PoiListPage extends StatelessWidget {
  final List<String> poiList;
  const PoiListPage({super.key, required this.poiList});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text("Poi")),
      body: ListView.separated(
        itemCount: poiList.length,
        separatorBuilder: (BuildContext context, int index) {
          final entry = poiList[index];
          return ListTile(
            title: Text(entry),
            trailing: Icon(Icons.arrow_forward_ios),
            onTap: () {
              Get.back(result: entry);
            },
          );
        },
        itemBuilder: (BuildContext context, int index) {
          return Divider();
        },
      ),
    );
  }
}
